package com.ssm.opa.common.base.log;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * <p/>
 * Copyright: Copyright (c) 2016/12/5
 * <p/>
 * Company: 途牛科技有限公司华东分公司
 * <p/>
 *
 * @author wanghongqi@tuniu.com
 * @version 1.0.0
 * @project gtb-parent
 */
public class BusinessLogger {
	private static Logger LOGGER = LoggerFactory.getLogger(BusinessLogger.class);

	// info日志构造
	public static void info(String module,String action, String key, Long duration, String msg, Integer status) {
		BusinessLogTemplate template = new BusinessLogTemplate(module, action, key, duration, status, 200, msg);
		LOGGER.info(template.toString());
	}

	// error日志构造
	public static void error(String module,String action, String key, Long duration, int errorCode, String msg, Integer status) {
		BusinessLogTemplate template = new BusinessLogTemplate(module, action, key, duration, status, errorCode, msg);
		template.setLevel("error");
		LOGGER.info(template.toString());
	}

}
